﻿using Compass.Wasm.Shared.Categories;

namespace Compass.Wasm.Shared.Purchases;

public class NavMonthlyValuationDto : BaseDto
{
    #region 从Item获取
    //物料编码
    private string number;
    public string Number { get => number; set { number=value; OnPropertyChanged(); } }

    //开始
    private string start;
    public string Start { get => start; set { start=value; OnPropertyChanged(); } }

    private Sbu_e sbu;
    public Sbu_e Sbu { get => sbu; set { sbu=value; OnPropertyChanged(); } }

    //中文描述/产品编号
    private string? description;
    public string? Description { get => description; set { description = value; OnPropertyChanged(); } }

    //计量单位
    private Unit_e unit;
    public Unit_e Unit { get => unit; set { unit=value; OnPropertyChanged(); } }

    //单位成本
    private double unitCost;
    public double UnitCost { get => unitCost; set { unitCost = value; OnPropertyChanged(); } }

    //库存
    private double inventory;
    public double Inventory { get => inventory; set { inventory = value; OnPropertyChanged(); } }

    //库存货值=Inventory*UnitCost
    private double invValue;
    public double InvValue { get => invValue; set { invValue = value; OnPropertyChanged(); } }

    //安全库存
    private double safetyStock;
    public double SafetyStock { get => safetyStock; set { safetyStock=value; OnPropertyChanged(); } }

    //安全库存货值=SafetyStock*UnitCost
    private double ssValue;
    public double SsValue { get => ssValue; set { ssValue=value; OnPropertyChanged(); } }

    private int openPo;
    public int OpenPo { get => openPo; set { openPo = value; OnPropertyChanged(); } }

    //OpenPo货值=OpenPo*UnitCost
    private double openPoValue;
    public double OpenPoValue { get => openPoValue; set { openPoValue = value; OnPropertyChanged(); } }

    //MinimalTotalProcessingTime
    //MTPT=30*InvValue/ConsAvg12Value
    private int mtpt;
    public int MTPT { get => mtpt; set { mtpt = value; OnPropertyChanged(); } }
    #endregion

    #region Cons计算
    //最近12个月消耗频次
    private int consfrequency;
    public int ConsFrequency { get => consfrequency; set { consfrequency = value; OnPropertyChanged(); } }
    //12个月平均消耗
    private double consAvg12;
    public double ConsAvg12 { get => consAvg12; set { consAvg12=value; OnPropertyChanged(); } }

    //12个月平均消耗货值
    private double consAvg12Value;
    public double ConsAvg12Value { get => consAvg12Value; set { consAvg12Value=value; OnPropertyChanged(); } }

    //6个月平均消耗
    private double consAvg6;
    public double ConsAvg6 { get => consAvg6; set { consAvg6=value; OnPropertyChanged(); } }

    //3个月平均消耗
    private double consAvg3;
    public double ConsAvg3 { get => consAvg3; set { consAvg3=value; OnPropertyChanged(); } }
    #endregion

    #region Recv计算
    //最近12个月入库频次
    private int recvfrequency;
    public int RecvFrequency { get => recvfrequency; set { recvfrequency = value; OnPropertyChanged(); } }
    //12个月平均入库
    private double recvAvg12;
    public double RecvAvg12 { get => recvAvg12; set { recvAvg12=value; OnPropertyChanged(); } }

    //12个月平均入库货值
    private double recvAvg12Value;
    public double RecvAvg12Value { get => recvAvg12Value; set { recvAvg12Value=value; OnPropertyChanged(); } }

    //6个月平均入库
    private double recvAvg6;
    public double RecvAvg6 { get => recvAvg6; set { recvAvg6=value; OnPropertyChanged(); } }

    //3个月平均入库
    private double recvAvg3;
    public double RecvAvg3 { get => recvAvg3; set { recvAvg3=value; OnPropertyChanged(); } }
    #endregion

    public List<NavInvValuationDto> NavInvValuationDtos { get; set; }
}

public class NavMonthlyValuationNoEnum
{
    public string Number { get; set; }
    public string Start { get; set; }
    public string Sbu { get; set; }
    public string Description { get; set; }
    public string Unit { get; set; }

    public double UnitCost { get; set; }
    public double Inventory { get; set; }
    public double InvValue { get; set; }
    public double SafetyStock { get; set; }
    public double SsValue { get; set; }
    public double OpenPo { get; set; }
    public double OpenPoValue { get; set; }
    public double MTPT { get; set; }

    public double ConsFrequency { get; set; }
    public double ConsAvg12 { get; set; }
    public double ConsAvg12Value { get; set; }
    public double ConsAvg6 { get; set; }
    public double ConsAvg3 { get; set; }

    public double RecvFrequency { get; set; }
    public double RecvAvg12 { get; set; }
    public double RecvAvg12Value { get; set; }
    public double RecvAvg6 { get; set; }
    public double RecvAvg3 { get; set; }

    //public double ConsMonth1 { get; set; }
    //public double ConsMonth1Value { get; set; }
    //public double ConsMonth2 { get; set; }
    //public double ConsMonth2Value { get; set; }
    //public double ConsMonth3 { get; set; }
    //public double ConsMonth3Value { get; set; }
    //public double ConsMonth4 { get; set; }
    //public double ConsMonth4Value { get; set; }
    //public double ConsMonth5 { get; set; }
    //public double ConsMonth5Value { get; set; }
    //public double ConsMonth6 { get; set; }
    //public double ConsMonth6Value { get; set; }
    //public double ConsMonth7 { get; set; }
    //public double ConsMonth7Value { get; set; }
    //public double ConsMonth8 { get; set; }
    //public double ConsMonth8Value { get; set; }
    //public double ConsMonth9 { get; set; }
    //public double ConsMonth9Value { get; set; }
    //public double ConsMonth10 { get; set; }
    //public double ConsConsMonth10Value { get; set; }
    //public double ConsMonth11 { get; set; }
    //public double ConsMonth11Value { get; set; }
    //public double ConsMonth12 { get; set; }
    //public double ConsMonth12Value { get; set; }
}